package com.mayisoftware.mayioa.business.pool.impl.serviceImpl;

import com.mayisoftware.mayioa.business.pool.api.domain.PoolMgrInfo;
import com.mayisoftware.mayioa.business.pool.api.service.IPoolManualService;
import com.mayisoftware.mayioa.business.pool.impl.dao.PoolManualMapper;
import com.mayisoftware.mayioa.platform.impl.util.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 手动配置骨干
 */
@Service
public class PoolManualServiceImpl implements IPoolManualService {

    /**
     * 骨干数据查询
     */
    @Autowired
    private PoolManualMapper poolManualMapper;

    @Override
    public List<PoolMgrInfo> queryBackbonePoolList() {
        return poolManualMapper.selectBackbonePoolList();
    }

    @Override
    public List<PoolMgrInfo> queryPoolList(PoolMgrInfo record) {
        return poolManualMapper.selectPoolList(record, ShiroUtils.getUserId());
    }

    @Override
    public List<PoolMgrInfo> queryPoolListById(String recordId) {
        return poolManualMapper.selectPoolListById(recordId);
    }

    @Override
    public int addPoolInfo(PoolMgrInfo record) {
        return poolManualMapper.insertPoolInfo(record);
    }

    @Override
    public int rmvPoolByIds(Integer[] recordIds) {
        return poolManualMapper.deletePoolByIds(recordIds);
    }

    @Override
    public int modifyPoolInfo(PoolMgrInfo record) {
        return poolManualMapper.updatePoolInfo(record);
    }

    @Override
    public int modifyPoolInfoToCacl() {
        return poolManualMapper.updatePoolInfoToCacl();
    }

    @Override
    public int modifyPoolInfoByUserPlan(PoolMgrInfo record) {
        return poolManualMapper.updatePoolInfoByUserPlan(record);
    }

    @Override
    public List<PoolMgrInfo> queryPoolListByStatus() {
        return poolManualMapper.selectPoolListByStatus();
    }

    @Override
    public List<PoolMgrInfo> queryPoolListByUserId( String userId){
        return  poolManualMapper.selectPoolListByUserId(userId, ShiroUtils.getUserId());
    }

    @Override
    public List<PoolMgrInfo> queryPoolListByUserId(String userId, Long loginId) {
        return  poolManualMapper.selectPoolListByUserId(userId,loginId);
    }
}
